﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PersonList.aspx.cs" Inherits="Contacts.Web.PersonList" %>
<%@ Register Assembly="Contacts.Web" Namespace="Contacts.Web" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

         <h2 class="h2Style">
<asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="aspBtn" Width="60" Height="22"  BorderWidth="1" onclick="BtnSearchClick" ValidationGroup="SearchReq" />
            <asp:TextBox ID="txtSearch" runat="server" Width="120px" 
               ontextchanged="BtnSearchClick" 
               
               ToolTip="Если Вы знаете только Фамилию человека, то поставте пробел и напишите её."></asp:TextBox> - contact(s) from -
               <asp:DropDownList ID="ddSearchGroup" runat="server" Width="120px"
                           AppendDataBoundItems="true">
            <asp:ListItem Selected="True" Value="0">All</asp:ListItem>
         </asp:DropDownList> - group(s)</h2>

        	<div id="formSection">
        		<div id="offerForm">
               
    <table class="centerTable">
      <tr>
       <td>
           <cc1:GridView ID="personsView" runat="server" AutoGenerateColumns="False" 
               DataKeyNames="PersonID,GroupID" onrowcommand="personsView_OnRowCommand" 
              CellPadding="4" EnableModelValidation="True" ForeColor="#333333" 
              GridLines="None" onrowdatabound="personsView_RowDataBound" Width="100%"
              AllowPaging="true" PageSize="5" 
              OnPageIndexChanging="personsView_PageIndexChanging" 
              EnableNextPrevNumericPager="true" >
              <EditRowStyle BackColor="#999999" />
              <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
              <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />


              <PagerStyle BackColor="LightGray" ForeColor="White" HorizontalAlign="Center" />
              <RowStyle BorderColor="#D6D6D6" BorderWidth="2px" HorizontalAlign="Center" 
                 VerticalAlign="Middle" BackColor="#F7F6F3" ForeColor="#333333" />
              <AlternatingRowStyle BackColor="White" ForeColor="#5D7B9D" />
              <Columns>
              <asp:BoundField DataField="PersonID" HeaderText="ID" Visible="False" />
              <asp:BoundField DataField="FirstName" HeaderText="Имя" />
              <asp:BoundField DataField="LastName" HeaderText="Фамилия" />
              <asp:BoundField DataField="Phone" HeaderText="Телефон" HeaderStyle-Width="100px" >
<HeaderStyle Width="100px"></HeaderStyle>
                 </asp:BoundField>
              <asp:BoundField DataField="Email" HeaderText="Почта" HeaderStyle-Width="1px" >
<HeaderStyle Width="1px"></HeaderStyle>
                 </asp:BoundField>
              <asp:BoundField DataField="Birthday" HeaderText="ДР" 
                    DataFormatString="{0:dd MMM yyyy}" HeaderStyle-Width="80px" >
<HeaderStyle Width="80px"></HeaderStyle>
                 </asp:BoundField>
              <asp:BoundField DataField="Photo" HeaderText="Фото" Visible="false" />
              <asp:BoundField DataField="GroupID" HeaderText="Группа№" Visible="false" />
              <asp:BoundField DataField="GroupName" HeaderText="Группа" 
                    HeaderStyle-Width="80px" >
<HeaderStyle Width="80px"></HeaderStyle>
                 </asp:BoundField>
              <asp:ImageField DataImageUrlFormatString="GetImage.aspx?file={0}" 
                    DataImageUrlField="Photo" HeaderText="Фото" ItemStyle-Width="100px" 
                    ControlStyle-Width="100px" >
<ControlStyle Width="100px"></ControlStyle>

<ItemStyle Width="100px"></ItemStyle>
                 </asp:ImageField>
              <asp:TemplateField HeaderStyle-Width="20px">
               <ItemTemplate>
                  <asp:LinkButton ID="btnEdit" runat="server" Text="Edit" CommandName="EditCmd"  CommandArgument='<%# Eval("PersonID").ToString() + "|" + Eval("Photo").ToString() %>' />
                  <asp:LinkButton ID="btnDelete" runat="server" Text="Delete" CommandName="DeleteCmd" CommandArgument='<%# Eval("PersonID").ToString() + "|" + Eval("Photo").ToString() %>' />
               </ItemTemplate>

<HeaderStyle Width="20px"></HeaderStyle>
              </asp:TemplateField>
              </Columns>
               <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />



           </cc1:GridView>
       </td>
      </tr>


    </table>
      <div class="centerObj"><p><a href="PersonEditor.aspx" title="Add" class="button" 
            tabindex="1">Add</a></p></div>

				</div>
        	</div><!-- end #formSection -->


</asp:Content>
